From cb3034fae9c79585392e46f6c0bf4e519f36cce4 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Tue, 11 Nov 2003 09:29:53 +0000 Subject: [PATCH] bitkeeper revision 1.587.1.1 (3fb0ac11yZXqdnSpzEWZKpz5wvvO-w) Makefile: Remove netwatch for now --- first we need a story on how to propagate IP-address changes to guests .del-xen_netwatch.c~a4c28975caeddf9f: Delete: tools/misc/xen_netwatch.c .del-xen_netwatch_redhatscript~cac0420836f2394a: Delete: tools/misc/xen_netwatch_redhatscript --- .rootkeys | 2 - tools/misc/Makefile | 5 +- tools/misc/xen_netwatch.c | 225 --------------------------- tools/misc/xen_netwatch_redhatscript | 33 ---- 4 files changed, 1 insertion(+), 264 deletions(-) delete mode 100644 tools/misc/xen_netwatch.c delete mode 100755 tools/misc/xen_netwatch_redhatscript diff --git a/.rootkeys b/.rootkeys index 50045fa3b5..56509fae19 100644 --- a/.rootkeys +++ b/.rootkeys @@ -191,8 +191,6 @@ 3f8bcf29ulZIC9rC4wM70H_q4s6VPg tools/misc/xen_log.c 3f13d81eQ9Vz-h-6RDGFkNR9CRP95g tools/misc/xen_nat_enable 3f13d81e6Z6806ihYYUw8GVKNkYnuw tools/misc/xen_nat_enable.README -3fafbef1fJFKCcJLq-ffpauvpM10jQ tools/misc/xen_netwatch.c -3fafd0abTbQjsCr5W3DDyNdqdJezrA tools/misc/xen_netwatch_redhatscript 3f1668d4F29Jsw0aC0bJEIkOBiagiQ tools/misc/xen_read_console.c 3f87ba90EUVPQLVOlFG0sW89BCwouQ tools/misc/xen_refresh_dev.c 3f72f1bdJPsV3JCnBqs9ddL9tr6D2g xen/COPYING diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 1eda792f69..a60498bbb8 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -7,7 +7,7 @@ HDRS = $(wildcard *.h) SRCS = $(wildcard *.c) OBJS = $(patsubst %.c,%.o,$(SRCS)) -TARGETS = xen_read_console xen_cpuperf xen_refresh_dev xen_netwatch +TARGETS = xen_read_console xen_cpuperf xen_refresh_dev INSTALL = $(TARGETS) xen-mkdevnodes xen_nat_enable xen-clone @@ -25,9 +25,6 @@ clean: $(RM) *.o $(TARGETS) $(MAKE) -C miniterm clean -xen_netwatch: %: %.c $(HDRS) Makefile - $(CC) $(CFLAGS) -o $@ $< - %: %.c $(HDRS) Makefile $(CC) $(CFLAGS) $(EXTRA_INC) -o $@ $< diff --git a/tools/misc/xen_netwatch.c b/tools/misc/xen_netwatch.c deleted file mode 100644 index 9e1194e329..0000000000 --- a/tools/misc/xen_netwatch.c +++ /dev/null @@ -1,225 +0,0 @@ -/****************************************************************************** - * xen_netwatch.c - * - * Watch for network interfaces changing state (IFF_UP), and call a standard - * script '/etc/xen/netwatch up|down'. Logging from the netwatch - * daemon is written to '/var/xen/netwatch' -- other programs can therefore - * watch that file to take action on interface state changes. - * - * Note that, apart from the names of the default action script and log file, - * this program is not actually Xen-dependent. - * - * Copyright (c) 2003, K A Fraser - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#define DEFAULT_SCRIPT "/etc/xen/netwatch" -#define DEFAULT_LOGFILE "/var/xen/netwatch" - -#define LOG(_f, _a...) \ - do { \ - time_t now = time(NULL); \ - char *tstr = ctime(&now); \ - char *p = strchr(tstr, '\n'); if (p) *p = '\0'; \ - fprintf(logfd, "%s: " _f "\n", tstr, ## _a); \ - fflush(logfd); \ - } while ( 0 ) - -#define EXIT do { LOG("Exiting."); return 1; } while ( 0 ) - -static void daemonise(void) -{ - int i; - struct rlimit rlim; - - /* Close all file handles we inherited from our parent. */ - if ( getrlimit(RLIMIT_NOFILE, &rlim) == 0 ) - for ( i = 0; i < rlim.rlim_cur; i++ ) - close(i); - - /* Lose the controlling tty. */ - setsid(); -} - -void handle_child_death(int dummy) -{ - (void)waitpid(-1, NULL, WNOHANG); -} - -int main(int argc, char **argv) -{ - char *logfile = DEFAULT_LOGFILE; - char *scriptfile = DEFAULT_SCRIPT; - FILE *logfd; - int i, nlfd, unixfd, bytes, last_index = ~0; - unsigned int last_flags = ~0; - char buffer[8192]; - struct sockaddr_nl nladdr; - struct nlmsghdr *nlmsg; - struct ifinfomsg *ifi; - struct ifreq ifr; - struct sigaction sigchld; - - for ( i = 1; i < argc; i++ ) - { - if ( strncmp("-s", argv[i], 2) == 0 ) - { - scriptfile = argv[i] + 2; - } - else if ( strncmp("-l", argv[i], 2) == 0 ) - { - logfile = argv[i] + 2; - } - else - { - printf("Usage: %s [-s